package com.java0108;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Fanse01 {
    public static void main(String[] args) throws ClassNotFoundException {
        Class c = Class.forName("com.java0108.Student");
        Field[] declaredFields = c.getDeclaredFields();
        for(Field f : declaredFields){
            System.out.println(f.getName());
        }

        Method[] declaredMethods = c.getDeclaredMethods();
        for(Method m:declaredMethods){
            System.out.println(m.getName());
        }

        Constructor[] declaredConstructors = c.getDeclaredConstructors();
        for(Constructor s : declaredConstructors){
            System.out.println(s.getName());
        }


    }

}
class Student{
    String name;
    int age;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}